package com.zh.springcloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.ZonedDateTime;

/**
 * @Description:
 * @ClassName GatewayConfig
 * @date: 2021.07.09 15:12
 * @Author: zhanghang
 */
@Configuration
public class GatewayConfig {
	public static void main(String[] args) {
		ZonedDateTime now = ZonedDateTime.now();
		System.out.println(now);
	}

//	@Bean
//	public RouteLocator getRouteLocator(RouteLocatorBuilder builder){
//		// 相当于yml文件中的 routes
//		RouteLocatorBuilder.Builder routes = builder.routes();
//		// payment-routh 相当于 yml文件中的 id
//		// /payment/** 相当于yml文件中的 predicates 断言
//		// http://lcoalhost:8001 相当于yml文件中的 uri
//		routes.route("payment-routh", route -> route.path("/payment/**").uri("lb://cloud-payment-service")).build();
//		return routes.build();
//	}
}
